from django.urls import path, re_path

from application import views
from application.views import student_view_set
from application.views.api_view_crud import StudentsAPIView, StudentDetailAPIView
from application.views.student_view_set import StudentViewSet

urlpatterns = (
    [
        path('stu/', StudentsAPIView.as_view()),
        re_path(r'^stu/(?P<pk>\d+)/$', StudentDetailAPIView.as_view()),
        path('students/', StudentViewSet.as_view({"get": "list", "post": "create"})),
        re_path(r"^students/(?P<pk>\d+)/$",
                StudentViewSet.as_view({"get": "retrieve", "put": "update", "delete": "destroy"}))
    ]
)
